package Thread;

public class Demo23 {
    public static void main(String[] args) throws InterruptedException {
        Object lock = new Object();
        System.out.println("waiting for lock");
        synchronized (lock) {
            lock.wait();
        }
        System.out.println("wait finished");
    }
}
